package day6.homework;

import java.util.Arrays;

// @Data
public class Teacher {
	// 属性 全局变量(全局变量有默认值)
	int id;
	private String name; // null
	private int age; // 0
	private double salary;// 0.0
	private int[] array;// null 
	// 代表所有引用数据类型的默认值都是null
	
	// 无参构造方法
	public Teacher() {
		System.out.println("Teacher.Teacher()");
	}
	
	// 有参构造方法
	public Teacher(int id, String name, int age, double salary) {
		this.id = id;
		this.name = name;
		this.age = age;
		this.salary = salary;
	}
	
	// 方法
	public int getAge() {
		// ....
		return age;
	}
	
	public void setAge(int age) {
		// age = teacherAge;
		this.age = age;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getSalary() {
		return salary;
	}

	public void setSalary(double salary) {
		this.salary = salary;
	}

	public int[] getArray() {
		return array;
	}

	public void setArray(int[] array) {
		this.array = array;
	}

	@Override
	public String toString() {
		return "Teacher [id=" + id + ", name=" + name + ", age=" + age + ", salary=" + salary + ", array="
				+ Arrays.toString(array) + "]";
	}
	
	
}
